cat >> /etc/anaconda-scripts.d/livecd-init/11-gnome.sh << 'EOF'
#!/bin/bash
# Autologin gdm
echo "[daemon]
AutomaticLoginEnable=True
AutomaticLogin=live" > /etc/gdm/custom.conf
# X11 for i686
if [ "$(uname -m)" = "i686" ]; then
	dnf install -y gnome-session-x11-session
	dnf remove -y gnome-session-wayland-session
fi
# Anaconda gnome desktop
sed -i 's/ROSA Linux/ROSA Linux GNOME/' /home/live/Desktop/anaconda-rosa.desktop /usr/share/applications/anaconda-rosa.desktop
	# Set tty langs
if [ -n "$LANGUAGE" ] && [ "${LANGUAGE:0:2}" = "ru" ]; then
	localectl set-keymap ruwin_ct_sh-UTF-8
fi
EOF
chmod +x /etc/anaconda-scripts.d/livecd-init/11-gnome.sh

mkdir -p /etc/anaconda-scripts.d/post-install/
cat >> /etc/anaconda-scripts.d/post-install/11-gnome.sh << 'EOF'
#!/bin/bash
# Get anaconda langs
X11_LANGS="$(localectl status |grep "X11 Layout: " |rev |cut -d" " -f1 |rev)"
WAYLAND_LANGS="$(echo $X11_LANGS |sed "s/,/\x27), (\x27xkb\x27, \x27/" |sed "s/^/[(\x27xkb\x27, \x27/" |sed "s/$/\x27)]/")"
# Set wayland langs
gsettings set org.gnome.desktop.input-sources sources "$WAYLAND_LANGS"
if echo $X11_LANGS |grep -q ru; then
	# Set tty langs
	localectl set-keymap ruwin_ct_sh-UTF-8
fi
EOF
chmod +x /etc/anaconda-scripts.d/post-install/11-gnome.sh
